package model.locations;

import java.util.ArrayList;
import java.util.List;

import exceptions.ThingNotInArea;

import model.things.Thing;


public class Path extends Area {

	public Path(List<Thing> list){
		thingsInArea = new ArrayList<Thing>();
		// You cannot add null to a list.
		if(list!=null) this.thingsInArea.addAll(list);
		description="you are on a path";
	}
	public Path(){
		// You cannot add null to a list.
		thingsInArea = new ArrayList<Thing>();
		description="you are on a path";
	}
	
	public List<Thing> getThingsInVicinity() throws ThingNotInArea{
		if(thingsInArea.size()>0)
		return thingsInArea;
		throw new ThingNotInArea("nothing here");
	}


	
	@Override
	public String getType() {
		// TODO Auto-generated method stub
		return "PATH";
	}
	
	public void addDescription(String descrip) {
		description=descrip;
		
	}

	public String getDescription() {
		// TODO Auto-generated method stub
		String d = "";
		d += description;
		for( Thing t : thingsInArea ) d += "\n"+t.getLabel()+" is here.";
		return d;
	}
}
